<?php
use \ldl\mysql\DbManager;
use \ldl\mysql\DbTable;
use \ldl\mysql\LtableBase;

require(__DIR__.'/../vendor/autoload.php');
define("DB_HOST","127.0.0.1");
define("DB_USER","esp");
define("DB_PASS","esp");
define("DB_NAME","esp");
//$db=new DbManager();
//$sql="select * from XXL_JOB_QRTZ_LOCKS";
//var_dump($db->execute($sql));
//echo LtableBase::field("xa","",">")."\n";

//echo LtableBase::delete("xa",array('id'=>12))."\n";

//echo LtableBase::select("xa",array('id'=>12)).LtableBase::limit(1,2).LtableBase::order(array("id","v"))."\n";

//echo LtableBase::insert("xa",array('id'=>12))."\n";

//echo LtableBase::update("xa",array('vv'=>1),array('id'=>1))."\n";

$aa= new DbTable("dede_addon17");

$id1=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxs11d555'));
$id1=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxs11d444'));
$id1=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxs11d333'));
$id1=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxs11d222'));
$id1=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxs11d111'));
$id1=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxs11dxx'));
$id2=$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'12xxx11'));
echo $aa->update(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'1xx11'),array('aid'=>$id1));
echo "==\n==\n";
$aa->delete(array('aid'=>$id1));
var_dump($aa->select(array()));
echo $aa->count(array());

#$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'13'));

#$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'14'));
#$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'15'));
#$aa->insert(array('spiderid'=>'1','sitedomain'=>'x.com','content_hash'=>'16'));

//$aa->fetchs(array(1,2));

//echo LtableBase::update("xa",array('vv'=>1),array('id'=>1))."\n";
//echo LtableBase::update("xa",array('vv'=>1),array('id'=>1))."\n";
//$dd=$aa->count(array());
//$dd=$aa->fetch(1);
//
//$a=$aa->insert(array('v'=>"x".time()));

//$a=$aa->select(array('v'=>"x1498784252"));
//$a=$aa->select(array());

//$a=$aa->count(array());
//$a=$aa->count(array('v'=>"x1498784252"));

//$a=$aa->update(array('v'=>"xxaafsxx33"),"id in (25,26)");var_dump($a);

//$a=$aa->update(array('v'=>"xxa在啊aafsxx33"),array('id'=>'26'));var_dump($a);

//$a=$aa->delete(array('id'=>'25'));var_dump($a);

//echo LtableBase::update("xa",array('vv'=>1),array('id'=>1))."\n";
//$dd=$aa->select(array());
//var_dump($dd);
//$aa->getDb();

//$where['where']="id > %d";
//$where['arg'][]="0";
//$d=$aa->count($where,0,0,"v");
//var_dump($aa);
